package clark.main

import com.trolltech.qt.gui.QFont
import xml.XML
import clark.model.Tools

/**
 * Created by IntelliJ IDEA.
 * Date: 11-3-11
 * Time: 下午3:11
 * @author 崔钢
 * clarkhillm@gmail.com
 *
 */
object Configuration {
    var SystemFont = new QFont()
    var DataBaseLocation = Tools.getPath
    var isCreate = false
    var DBName = "note"

    val xml = <note>
        <font>
            <name>
                {SystemFont.family}
            </name>
            <size>
                {SystemFont.pointSize}
            </size>
        </font>
        <location>
            {DataBaseLocation}
        </location>
        <name>
            {DBName}
        </name>
        <creat>
            {isCreate}
        </creat>
    </note>

    def save {
        XML.save(Tools.getPath + "conf.xml", xml, "utf-8", false, null)
    }

    def main(args: Array[String]) {
        save
    }
}